# 查看数据类型
# print(type(str(123))) # Output: <class 'str'>
# str=int('123')
# print(type(str), str) # Output: <class 'int'>

# 引号的使用
# print('I\'m "Rasion"') # I'm "Rasion"
# print("I'm \"Rasion\"") # I'm "Rasion"

# 字符串格式化输出
# name='Rasion'
# age=20
# print('My name is %s and I\'m %d years old.' % (name, age)) # My name is Rasion and I'm 20 years old.

# 字符串格式化输出(f-string)
# name='Rasion'
# age=20.0
# print(f"My name is {name} and I'm {age:.2f} years old.") # My name is Rasion and I'm 20.00 years old.

# 字符串格式化输出(format)
# print('I\'m %d years old.' % (20*20))
# print('I\'m {20*20} years old.')
# print('I\'m {0} years old, {1} years old, {2} years old.'.format(20, 20, 20))
# I'm 400 years old.
# I'm {20*20} years old.
# I'm 20 years old, 20 years old, 20 years old.

# 输入
# name = input('Please input your name: ')
# print('Hello,'+ name + '!')

# if语句
# age=int(input("请输入您的年龄："))
# if age>=18:
#     print("可以访问！")
# elif int(age)>=6:
#     print("可以带家人进入！")
# else:
#     print("禁止入内！")
# print(f"你的年龄是：{age}")

# 猜数字游戏
# import random
# num=random.randint(1,100)
# NUM_GUESSES=0
# print("猜数字游戏开始，请输入[1,100]之间的数字，你有5次机会")
# while True:
#     guess=int(input("请输入一个数字："))
#     NUM_GUESSES+=1
#     if NUM_GUESSES==5:
#         print("你已经用完5次机会，游戏结束！")
#         break
#     if guess==num:
#         print("猜对了！")
#         break
#     elif guess<num:
#         print("大一点！")
#     else:
#         print("小一点！")
# print(f"正确答案是：{num}")

# while循环之九九乘法表
# i=1
# while i<=9:
#     j=1
#     while j<=i:
#         print(f"{i}*{j}={i*j}\t",end=" ")
#         j+=1
#     print()
#     i+=1

# 1000以内的素数
count=0
for i in range(2,1000):
    is_prime=True
    for j in range(2,i):
        if i%j==0:
            is_prime=False
            break
    if is_prime:
        count+=1
        print(i,end=" \t")
        if count%20==0:
            print()